public void MyDependentScopedBean { private final Date createdDate; public MyDependentScopedBean { createdDate = new Date(); } }
In Errai IOC, all client types are valid bean types if they are default constructable or can have construction dependencies satisfied. These unqualified beans belong to the dependent pseudo-scope. See: Dependent Psuedo-Scope from CDI Documentation
Additionally, beans may be qualified as @ApplicationScoped, @Singleton or @EntryPoint. Although @ApplicationScoped and @Singleton are supported for completeness and conformance, within the client they effectively result in behavior that is identical.
public void MyDependentScopedBean { private final Date createdDate; public MyDependentScopedBean { createdDate = new Date(); } }
@ApplicationScoped public void MyClientBean { @Inject MyDependentScopedBean bean; // ... // }
As is mentioned in the bean manager documentation, only beans that are explicitly scoped will be made available to the bean manager for lookup. So while it is not necessary for regular injection, you must annotate your dependent scoped beans with @Dependent if you wish to dynamically lookup these beans at runtime.